function checkPower(){
    var level = getCookie('level');
    return (level>1) ? false : true;
}
function signout(){
    delCookie('username');
    delCookie('nickname');
    delCookie('level');
    window.location.href="login.html";
}
function checkLogin(){
    var session = getCookie('session'), userName = getCookie('username'),
        nickName = getCookie('nickname'), level = getCookie('level'), unitName = getCookie('unitname') || '';
    if(level!=null)level = parseInt(level);
    if(!session || !userName || !level){
        cout([session, userName, nickName, level]);
        window.location.href="login.html";
    }else{
        $('#u_username').html(userName);
        $('#u_username1').html(userName);
        $('#u_nickname').html(nickName);
        $('#u_unitname').html(unitName);
        $('#u_level').html('lv '+ level);
        $('#u_lvname').html((level<2 && '普通用户') || (level<3 && '高级用户') || (level<4 && '管理员')
            || (level<4 && '系统管理员') || ("超级管理员"));
    }
}


